import cn.lhl.entity.Dept;
import cn.lhl.entity.Emp;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

/**
 * Created by datou on 2017/1/17.
 */
public class text {
    public static void main(String[] args) {
        Session session=new Configuration().configure().buildSessionFactory().getCurrentSession();
        Transaction ts = session.beginTransaction();

        Dept dept=session.load(Dept.class ,1);
//        Emp emp=new Emp();
//        emp.setEname("aaaa");
//        Emp emp2=new Emp();
//        emp.setEname("aaaa");
//        Dept dept=new Dept();
//        dept.setDname("GG");
//        dept.getEmps().add(emp);
//        dept.getEmps().add(emp2);
//        session.save(dept);
        ts.commit();


    }
}
